<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width:300px;
      height: 300px;
      background-color: red;
    }
  </style>
</head>
<body>
  <div id="app">
  
    <button @click="change">按钮</button>
    <button @click="change($event, 2)">按钮2</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const fn = function(){
      alert(2)
    }
    const vm = new Vue({
      el: "#app",
      methods:{
        change(e,n){
          
          console.log(e)
          alert(n)
          // alert(1)
        }
      }
    })
    /*

    function fn(ev){
      var e = ev||event;
      xxxx
    } 
    btn.onclick = fn;
    btn.onclick = function(){
      fn()
    }
     */
  </script>
</body>
</html>
